<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample URL Shortener</title>
<link rel="stylesheet" type="text/css" href="css/styles.css" media="screen" />
<link rel="shortcut icon" href="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<script type="text/javascript">
function urlCheck(obj)
{
	if (!isUrl(document.getElementById("url").value))
	{
		alert ("The url in the textbox is not valid.  Please try again.");
                document.getElementById("url").focus();
                return false;
	}
	return true;
}

function isUrl(s) {
	var regexp = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
	return regexp.test(s);
}

window.onload = function(){document.getElementById("url").focus();};

</script>
</head>
<body>
<div id="header">
</div>
<div id="content">
<h2></h2>
<p>Enter a long url below and click <strong>Make Shorter</strong> to create an Example.com link.</p>
<div id="navtext"><a href="html/tools.html">Tools</a><a href="html/about.html">About</a><a href="html/contact.html">Contact</a></div>
<form action="create.html" method="get" onsubmit="return urlCheck(this);">
<input class="textbox" type="text" maxlength="2000" size="55" id="url" name="url" value="" />
<input class="button" type="submit" value="Make Shorter" />
</form>
</div>
</div>
</body>
</html>
